/**
 * Copyright (C) 2011 Andrew C. Love (DNC) <dnc.app.sup@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.dnc.cloak.framework.context;

import java.util.Map;
import java.util.Set;
import java.util.TreeMap;

import com.dnc.cloak.framework.security.SecurityContext;
import com.dnc.cloak.framework.security.SessionContext;

public class ContextImpl implements Context {
	
    private Map<String, String> properties = new TreeMap<String, String>();    
    private SecurityContext securityContext = null;
    private SessionContext sessionContext = null;
    //private IFrontController frontController = null;
    //private IApplicationController applicationController = null;
    
    private String country = "us";
    private String language = "en";

    public String getProperty(String name) {
        return properties.get(name);
    }

    public void setProperty(String name, String value) {
    	properties.put(name, value);
    }

    public Set<String> getPropertyNames() {
        return properties.keySet();
    }

    public void removeProperty(String name) {
    	properties.remove(name);
    }

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

    @Override
    public SecurityContext getSecurityContext() {
        return securityContext;
    }

    @Override
    public void setSecurityContext(SecurityContext securityContext) {
        this.securityContext = securityContext;
        
    }

    @Override
    public SessionContext getSessionContext() {
        return sessionContext;
    }

    @Override
    public void setSessionContext(SessionContext sessionContext) {
        this.sessionContext = sessionContext;        
    }	
	
}
